Skip to content

Conversation

@jmythms
Copy link
Collaborator

@jmythms jmythms commented Sep 8, 2025

This PR will update the current thermal load components data to the latest BuildStock data.

RESSTOCK vs Current Scout Data comparison:

Key notes:

  1. Cooling Infiltration: Major sign differences. And large numerical diffs.
    cooling_infiltration_sign_issue
  2. Cooling Equipment: High value for Resstock (diff is ~40%). Points towards other large components causing Equip to balance out the normalized value.
  3. Pacific Multi Family and Mobile Home shows large discrepancies across all components.
  4. New England mobile home show large Equip and Infil discrepancies.
  5. Heating matches better than cooling; differences are focused in Wind_cond in mobile homes.
grid_EQUIP grid_GRND grid_INFIL grid_ROOF grid_WALL grid_WIND_COND grid_WIND_SOL

How to interpret these plots:

  1. Color shows heating vs cooling.
  2. Sign change happens in quadrants II and IV.
  3. A large distance from the diagonal line means there was a large difference between new and old data.
  4. Components are normalized values and can be negative or <1.

More stats:

HEATING

Component Mean diff MAE Sign agree (%) Corr
EQUIP 0.162 0.164 85.185 0.904
GRND 0.021 0.108 100.000 0.189
INFIL 0.035 0.080 100.000 0.703
ROOF -0.094 0.099 100.000 0.499
WALL 0.017 0.067 100.000 0.621
WIND_COND -0.172 0.172 100.000 0.499
WIND_SOL -0.013 0.034 100.000 0.787

COOLING

Component Mean diff MAE Sign agree (%) Corr
EQUIP 0.401 0.401 100.000 0.152
GRND 0.027 0.091 70.370 0.216
INFIL -0.220 0.220 18.519 0.707
ROOF -0.084 0.086 100.000 0.279
WALL -0.011 0.078 92.593 -0.021
WIND_COND -0.060 0.063 51.852 0.626
WIND_SOL 0.011 0.098 100.000 0.558

Calculation methods:
Mean diff = (ResStock-ScoutCurrentData).mean()
MAE = (|ResStock-ScoutCurrentData|).mean()
Sign Agree = (if sign_ResStock == sign_ScoutCurrentData).mean() to percentage
Correlation = ResStock.corr(ScoutCurrentData)

@jmythms jmythms self-assigned this Sep 8, 2025
@jmythms
Copy link
Collaborator Author

jmythms commented Sep 8, 2025

Questions:

  1. Are we currently using the Climate Zone conversions in the R file in later Scout processing?
  2. There are no specific "people" components in the RESSTOCK file. There is however an internal_gains component? Repurpose that somehow?
  3. 1121 Buildings with nan type (out of 550,000 buildings).

Comment on lines +8 to +35
RESSTOCK_SEGMENT_TO_CATEGORY = {
# Windows / skylights
"windows_conduction": "WIND_COND",
"skylights_conduction": "WIND_COND",
"windows_solar": "WIND_SOL",
"skylights_solar": "WIND_SOL",
# Roof / ceilings
"roofs": "ROOF",
"ceilings": "ROOF",
# Walls / opaque
"walls": "WALL",
"foundation_walls": "WALL",
"rim_joists": "WALL",
"doors": "WALL",
# Infiltration / ventilation
"infiltration": "INFIL",
"mechanical_ventilation": "INFIL",
"natural_ventilation": "INFIL",
# Ground contact
"slabs": "GRND",
"floors": "GRND",
# Internal/equipment gains
"internal_gains": "EQUIP",
"internal_mass": "EQUIP",
"lighting": "EQUIP",
"whole_house_fan": "EQUIP",
"ducts": "EQUIP",
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Components: Resstock to Scout

Comment on lines 61 to 72
BLDG_MAPPING = {
'50 or more Unit': 'multi family home',
'Single-Family Detached': 'single family home',
'Single-Family Attached': 'single family home',
'Mobile Home': 'mobile home',
'20 to 49 Unit': 'multi family home',
'5 to 9 Unit': 'multi family home',
'3 or 4 Unit': 'multi family home',
'2 Unit': 'multi family home',
'10 to 19 Unit': 'multi family home',
'nan': None
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Building types mapping: RESSTOCK to Scout

@jmythms
Copy link
Collaborator Author

jmythms commented Sep 8, 2025

Questions:

  1. Are we currently using the Climate Zone conversions in the R file in later Scout processing?
  2. There are no specific "people" components in the RESSTOCK file. There is however an internal_gains component? Repurpose that somehow?
  3. 1121 Buildings with nan type (out of 550,000 buildings).

@jmythms to lump components in ecm_prep.py, mix in people component into internal gains.

@jmythms jmythms marked this pull request as ready for review September 18, 2025 20:53
@jmythms jmythms requested a review from aspeake September 18, 2025 21:03
@jmythms jmythms marked this pull request as draft September 24, 2025 15:02
Comment on lines 1 to 12
# ==============================================================================
# COMMERCIAL THERMAL LOADS DATA PROCESSING SCRIPT
# ==============================================================================
# This script processes base thermal loads data for commercial buildings and
# converts it from climate zone-based to census division-based organization
# for use in building energy modeling and analysis.
#
# Input: Com_TLoads_Base.csv - Base thermal loads data by climate zone
# Output: Com_TLoads_PrepFinal.txt - Processed thermal loads by census division
# Com_Cdiv_Czone_ConvertTablePrep.txt - Conversion factors
# Com_Cdiv_Czone_ConvertTablePrep_Rev.txt - Reverse conversion factors
# ==============================================================================
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep the R scripts here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets delete them

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment on lines 1 to 9
# ===============================================================================
# Residential Thermal Loads Processing Script
# ===============================================================================
# This script processes residential thermal loads data and creates conversion
# tables for mapping between census divisions and climate zones.
#
# Part 1: Process residential thermal loads by building type and end use
# Part 2: Create census division to climate zone conversion tables from RECS data
# ===============================================================================
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Residential scripts are here.

Comment on lines 80 to 85
ALL_COLS = [
"Unnamed: 0",
"building_id",
"job_id",
"started_at",
"completed_at",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this

@jmythms
Copy link
Collaborator Author

jmythms commented Sep 24, 2025

This PR will update the current thermal load components data to the latest BuildStock data.

RESSTOCK vs old data comparison:

Component Mean diff MAE Sign agree (%) Corr
EQUIP 0.281 0.283 92.593 0.908
GRND 0.024 0.100 85.185 0.697
INFIL -0.093 0.150 59.259 0.921
ROOF -0.089 0.092 100.000 0.502
WALL 0.003 0.072 96.296 0.702
WIND_COND -0.116 0.118 75.926 0.902
WIND_SOL -0.001 0.066 100.000 0.945

Divide heating and cooling

@jmythms
Copy link
Collaborator Author

jmythms commented Sep 24, 2025

verify if the other mseg_* files changed or not?

@jmythms jmythms marked this pull request as ready for review October 2, 2025 15:31
@jmythms jmythms force-pushed the issue-486/thermal_loads branch from fe7a4b5 to 5f6d082 Compare October 7, 2025 15:26
@jtlangevin jtlangevin linked an issue Oct 14, 2025 that may be closed by this pull request
@jmythms jmythms requested a review from jtlangevin October 14, 2025 17:41
@jmythms jmythms changed the title Thermal load components from BuildStock Residential thermal load components from ResStock Oct 14, 2025
@jtlangevin jtlangevin added this to the v1.2.0 milestone Oct 14, 2025
Copy link
Collaborator

@aspeake aspeake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The core script to generate Scout-compatible files looks to be correct, and I was able to successfully run it myself. I have a few questions, but I don't think my changes will result in new input files (or at least not change the final results).

Regarding the comparisons, I think they look pretty reasonable. The components/end uses that jump out tend to hover around zero so the relative differences can be high, or they are related to mobile homes which have a low saturation, and I trust their representation ResStock. That is to say that I think the differences are due to modeling assumptions, and not the methods implemented in this PR.


* Map residential table building types to AEO building types.
* Single-Family Detached -> single family home
* Single-Family Attached -> single family home
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtlangevin does this look right or should SFA map to multi family?

* Manually input data from the PDF publications, as in :repo_file:`Res_TLoads_Base.csv` and :repo_file:`Com_TLoads_Base.csv`.

3. Condense CSV tables into final set of thermal load components data using an R script.
3. Condense CSV tables into final set of thermal load components data using an R/Python script.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. Condense CSV tables into final set of thermal load components data using an R/Python script.
3. Condense CSV tables into final set of thermal load components data.

Comment on lines +145 to +146
Non-destructive: original component nodes are preserved under
['internal gains']['components_original'].
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed

for fuel_key, fuel_val in bldg_val.items():
if not isinstance(fuel_val, dict):
continue
# print(f"Processing {geo_key} {bldg_key} {fuel_key}")
Copy link
Collaborator

@aspeake aspeake Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete comment

Comment on lines 1 to 12
# ==============================================================================
# COMMERCIAL THERMAL LOADS DATA PROCESSING SCRIPT
# ==============================================================================
# This script processes base thermal loads data for commercial buildings and
# converts it from climate zone-based to census division-based organization
# for use in building energy modeling and analysis.
#
# Input: Com_TLoads_Base.csv - Base thermal loads data by climate zone
# Output: Com_TLoads_PrepFinal.txt - Processed thermal loads by census division
# Com_Cdiv_Czone_ConvertTablePrep.txt - Conversion factors
# Com_Cdiv_Czone_ConvertTablePrep_Rev.txt - Reverse conversion factors
# ==============================================================================
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets delete them

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am less picky on documentation and design of these scripts, but this function could use a more detailed description.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be able to just do an average instead of a weighted average

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused what this script does? Is it redundant with resstock_to_thermalLoads.py?

Copy link
Collaborator Author

@jmythms jmythms Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a python equivalent to scout\supporting_data\thermal_loads_data\Res_TLoads_Process.R. If we are not keeping the R scripts, delete this as well?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it do? Does it do something different than resstock_to_thermalLoads.py?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does the equivalent of resstock_to_thermalLoads.py, but for the previous original dataset using RECS microdata, etc.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay, in that case I think we can delete it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all the mseg files generated using the CDIV component load file? And just mapped in teh translator script?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update thermal load components data

3 participants